package com.sgb.kjwl.view.ui.adapter.home;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.swgk.core.view.entity.MenuEntity;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import com.swgk.core.recyclerview.adapter.PageRecycleAdapter;

import java.util.List;

public class HostMenuAdapter extends PageRecycleAdapter<MenuEntity> {

    private ImageView iv;
    private ImageView iv_2;

    public HostMenuAdapter(Context context, List<MenuEntity> datas) {
        super(context, R.layout.item_host_menu, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, MenuEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        iv = holder.itemView.findViewById(R.id.iv);
        iv_2 = holder.itemView.findViewById(R.id.iv_2);
        if (entity.getAppIcon().contains("http")){
            iv_2.setVisibility(View.GONE);
            iv.setVisibility(View.VISIBLE);
        }else {
            iv_2.setVisibility(View.VISIBLE);
            iv.setVisibility(View.GONE);
        }

    }
}
